/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.isd.global.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author ctrosch
 */
@Entity
@Table(name = "USR_TVCFIM", schema = "dbo")
public class HomeImagenes implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected HomeImagenesPK idPK;

    @Column(name = "USR_TVCFIM_NORDEN", insertable=false, updatable=false)
    private int orden;

    @ManyToOne
    @JoinColumn(name = "USR_TVCFIM_TVCONF_ID", referencedColumnName = "USR_TVCONF_ID", nullable = false, insertable=false, updatable=false)
    private Parametro parametro;

    @Basic(optional = false)
    @Column(name = "USR_TVCFIM_NOMIMG", nullable = false, length = 60)
    private String nomimg;
    @Column(name = "USR_TVCFIM_TITULO", length = 60)
    private String titulo;
    @Column(name = "USR_TVCFIM_DEBAJA")
    private String habilitado;


    public HomeImagenes() {
    }

    public HomeImagenes(HomeImagenesPK homeImagenesPK) {
        this.idPK = homeImagenesPK;
    }

    public HomeImagenes(HomeImagenesPK homeImagenesPK, String usrTvcfimNomimg) {
        this.idPK = homeImagenesPK;
        this.nomimg = usrTvcfimNomimg;
    }

    public HomeImagenes(int orden, int parametroId) {
        this.idPK = new HomeImagenesPK(orden, parametroId);
    }

    public String getHabilitado() {
        return habilitado;
    }

    public void setHabilitado(String habilitado) {
        this.habilitado = habilitado;
    }

    
    public HomeImagenesPK getIdPK() {
        return idPK;
    }

    public void setIdPK(HomeImagenesPK idPK) {
        this.idPK = idPK;
    }

    public String getNomimg() {
        return nomimg;
    }

    public void setNomimg(String nomimg) {
        this.nomimg = nomimg;
    }

    public int getOrden() {
        return orden;
    }

    public void setOrden(int orden) {
        this.orden = orden;
    }

    public String getTitulo() {
        return titulo;
    }

    public void setTitulo(String titulo) {
        this.titulo = titulo;
    }

    public Parametro getParametro() {
        return parametro;
    }

    public void setParametro(Parametro parametro) {
        this.parametro = parametro;
    }

    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPK != null ? idPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HomeImagenes)) {
            return false;
        }
        HomeImagenes other = (HomeImagenes) object;
        if ((this.idPK == null && other.idPK != null) || (this.idPK != null && !this.idPK.equals(other.idPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.global.web.HomeImagenes[idPK=" + idPK + "]";
    }

}
